package com.mzj.saas.jobs.bill.repository;

import com.mzj.saas.jobs.bill.entity.CommunityHouseUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author hikari
 * @since 2021-05-25
 */
@Repository
public interface CommunityHouseUserRepository extends JpaRepository<CommunityHouseUser, Long>, JpaSpecificationExecutor<CommunityHouseUser> {
    List<CommunityHouseUser> findByUserIdAndStatus(String userId, Integer status);

    List<CommunityHouseUser> findByMobileAndStatus(String mobile, Integer status);
    
    List<CommunityHouseUser> findByCommunityHouseIdAndStatusAndType(String communityHouseId, Integer status, Integer type);

    List<CommunityHouseUser> findByCommunityHouseIdAndStatus(String communityHouseId, Integer status);

    void deleteByCommunityHouseId(String communityHouseId);

    List<CommunityHouseUser> findByStatus( Integer status);
}
